﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace QLHOSO
{
    public partial class frmRel : DevExpress.XtraEditors.XtraForm
    {
        public frmRel()
        {
            InitializeComponent();
            InitRichEdit();
        }

        void InitRichEdit()
        {
            recMain.Options.Behavior.Save = DevExpress.XtraRichEdit.DocumentCapability.Disabled;
            recMain.Options.Behavior.SaveAs = DevExpress.XtraRichEdit.DocumentCapability.Disabled;
        }
        private void recMain_KeyDown(object sender, KeyEventArgs e)
        {
            if(e.KeyCode == Keys.S && e.Control)
            {
                if (MessageBox.Show("Bạn có muốn lưu và thoát ?", "Xác nhận", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    this.Dispose();
                }
                else
                {

                }
            }
            else if (e.KeyCode == Keys.F4 && e.Alt )
            {
                this.Dispose();
            }
        }

        private void btSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (MessageBox.Show("Bạn có muốn lưu và thoát ?", "Xác nhận", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                this.Dispose();
            }
            else
            {

            }
        }

        private void btExit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.Dispose();
        }
    }
}